<?php
ini_set("include_path", ".:../:./Zend:../Zend");
require_once 'Zend/Json.php';
require_once 'Zend/Date.php';
require_once 'Zend/Rest/Client.php';
$dbname = 'childdis';
$dbhost = 'cougar.wou.edu';
$dbuser = 'childdis';
$dbpass = 'no!dis';
$db = mysql_connect($dbhost,$dbuser,$dbpass);
?>
<html>
<body>
<h1>Zend_Service_Amazon test</h1>
<?

$request = 'http://ecs.amazonaws.com/onca/xml?Service=AWSECommerceService&SubscriptionId=wwwchilddisab-20&AWSAccessKeyId=19NTYTP992PDGV3JS2G2&Operation=ItemSearch&SearchIndex=Books&Keywords=9780873376075&ResponseGroup=Images,ItemAttributes,Small';
$response = file_get_contents($request);
echo htmlspecialchars($response, ENT_QUOTES);
$xml = simplexml_load_string($response);

$title = $xml->Items->Item->ItemAttributes->Title;
$author = $xml->Items->Item->ItemAttributes->Author;
$link = $xml->Items->Item->DetailPageURL;
$image = $xml->Items->Item->MediumImage->URL;

echo '<img src="'.$image.'" /><a href="'.$link.'">Title: '.$title.' by '.$author.'</a>';

/*
$p = xml_parser_create();
xml_parse_into_struct($p, $response, $vals, $index);
xml_parser_free($p);
echo "Index array<br>";
print_r($index);
echo "<br>Vals array<br>";
print_r($vals);
*/ 
?>
</body>
</html>